#!/usr/bin/env node

// jpg binary image file ===> base64 string

const fs = require('fs'),
      http = require('http')

const buf = fs.readFileSync('./qr-code.jpg')
const img_base64 = buf.toString('base64')
console.log(buf.toString('base64'))

const html = `<!Doctype html><html><body><img src="data:img/jpg;base64,${img_base64}"></body></html>`

http.createServer((req, res) => {
  res.end(html)
}).listen(8080)
